﻿using System;
using System.Linq.Expressions;
using PropertyExpression.Common;

namespace PropertyExpression.ReactiveRelation
{
    public static class CalcInitiatorExtensions
    {
        public static Func<TProperty, ICalcInitiator<TEntity>> _<TEntity, TProperty>(
            this ICalcInitiator<TEntity> calcInitiator,
            Expression<Func<TEntity, TProperty>> propertyExpression)
        {
            return calcInitiator.GetValue(propertyExpression.ToPropertyExpressionProxy());
        }
    }
}
